cmake_minimum_required(VERSION 3.27)
project(dll-test)
set(CMAKE_CXX_STANDARD 20)

# 设定输出目录
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release/lib)

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release/lib)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/Debug/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/Release/bin)

add_compile_definitions("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_definitions("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")

list(APPEND CMAKE_MODULE_PATH  "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
if (FALSE)
    set(KRTS_NAME "KrtsDemo")
    set(KRTS_PATH "C:/Program Files/Kithara/RealTime Suite Demo/dev")
    set(KRTS_CUSTOMER "DEMO")
else ()
    set(KRTS_NAME "LinkControl")
    set(KRTS_PATH "C:/Program Files/Kithara/LinkControl RealTime Driver/dev")
    set(KRTS_CUSTOMER "070075")
endif ()

find_package(KRTS REQUIRED)
# include(FetchContent)
# include(${CMAKE_SOURCE_DIR}/cmake/fmt.cmake)
# include(${CMAKE_SOURCE_DIR}/cmake/spdlog.cmake)

add_subdirectory(kernel-class)
add_subdirectory(kernel-dll)
add_subdirectory(user-app)